#include "stdafx.h"
#include "DConfigGlobals.h"

#ifdef CRYPTO_SUPPORT

class CBlowfish {
public:
	CBlowfish(const unsigned char* pKey, int keySize);
	void Encrypt(unsigned long* data, int blocks);
	void Decrypt(unsigned long* data, int blocks);

private:
	void Encipher(unsigned long* xl, unsigned long* xr);
	void Decipher(unsigned long* xl, unsigned long* xr);
	unsigned long F(unsigned long x);
	unsigned long P[18];
	unsigned long S[4][256];
	static const unsigned long Init_P[18];
	static const unsigned long Init_S[4][256];
};

#endif
